package Link;

/**
 * This is a test class to check if the ejb VerifyLinkEJB is working proper. 
 * 
 * @author Michael Moos
 * @author Knupp Reto
 */
public class TestClass_VerifyLinkEJB {

	/**
	 * Main-Routine to run the test class. 
	 * 
	 * @param args
	 */
	public static void main(String[] args) 
	{
    	VerifyLinkEJB ejb = new VerifyLinkEJB();
    	
    	/* print titel */
    	System.out.println("");
		System.out.println("--------------------------------------------");
		System.out.println("Test program to test the ejb");
		System.out.println("VerifyLinkEJB");
		System.out.println("--------------------------------------------");
		System.out.println();
		
		/* All this urls should be recognized as correct url's */
		System.out.println("--Postive testing---------------------------");
		System.out.println("Verify adress: https://www.sbb.ch    -> Is it a link: " + ejb.verifyLinkEJB("https://www.sbb.ch"));
		System.out.println("Verify adress: http://www.sbb.ch     -> Is it a link: " + ejb.verifyLinkEJB("http://www.sbb.ch"));
		System.out.println("Verify adress: http://www.sbb        -> Is it a link: " + ejb.verifyLinkEJB("http://www.sbb"));
		System.out.println("Verify adress: http://www.sbb.ch/de  -> Is it a link: " + ejb.verifyLinkEJB("http://www.sbb.ch/de"));
		System.out.println("Verify adress: http://ww.sbb.ch      -> Is it a link: " + ejb.verifyLinkEJB("http://ww.sbb.ch"));
		System.out.println("Verify adress: http://w.sbb.ch       -> Is it a link: " + ejb.verifyLinkEJB("http://w.sbb.ch"));
		System.out.println("Verify adress: http://sbb.ch         -> Is it a link: " + ejb.verifyLinkEJB("http://sbb.ch"));
		System.out.println("Verify adress: www.sbb.ch            -> Is it a link: " + ejb.verifyLinkEJB("www.sbb.ch"));
		System.out.println();
		/* All this urls should be recognized as not correct url's */
		System.out.println("--Negativ testing---------------------------");
		System.out.println("Verify adress: http:/www.sbb.ch      -> Is it a link: " + ejb.verifyLinkEJB("http:/www.sbb.ch"));
		System.out.println("Verify adress: http:www.sbb.ch       -> Is it a link: " + ejb.verifyLinkEJB("http:www.sbb.ch"));
		System.out.println("Verify adress: http://www.sbb.       -> Is it a link: " + ejb.verifyLinkEJB("http://www.sbb."));
		System.out.println("Verify adress: http://.sbb.ch        -> Is it a link: " + ejb.verifyLinkEJB("http://.sbb.ch"));
		System.out.println("Verify adress: http://sbb.           -> Is it a link: " + ejb.verifyLinkEJB("http://sbb."));
		System.out.println("Verify adress: http://sbb            -> Is it a link: " + ejb.verifyLinkEJB("http://sbb"));
		System.out.println("Verify adress: ww.sbb.ch             -> Is it a link: " + ejb.verifyLinkEJB("ww.sbb.ch"));
		System.out.println("Verify adress: w.sbb.ch              -> Is it a link: " + ejb.verifyLinkEJB("w.sbb.ch"));
		System.out.println("Verify adress: .sbb.ch               -> Is it a link: " + ejb.verifyLinkEJB(".sbb.ch"));
		System.out.println("Verify adress: sbb.ch                -> Is it a link: " + ejb.verifyLinkEJB("sbb.ch"));
		System.out.println("Verify adress: .ch                   -> Is it a link: " + ejb.verifyLinkEJB(".ch"));
		System.out.println("Verify adress: ch                    -> Is it a link: " + ejb.verifyLinkEJB("ch"));
		System.out.println("Verify adress:                       -> Is it a link: " + ejb.verifyLinkEJB(""));
		System.out.println("Verify adress: 1                     -> Is it a link: " + ejb.verifyLinkEJB("1"));	
		System.out.println();
		System.out.println("Test successfully finished.");		
	}
}
